package com.ruoyi.project.poem.subject.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.poem.subject.mapper.PkSubjectMapper;
import com.ruoyi.project.poem.subject.domain.PkSubject;
import com.ruoyi.project.poem.subject.service.IPkSubjectService;
import com.ruoyi.common.utils.text.Convert;
import com.ruoyi.framework.aspectj.lang.annotation.DataSource;
import com.ruoyi.framework.aspectj.lang.enums.DataSourceType;

/**
 * 诗词考题Service业务层处理
 * 
 * @author shixiangwen
 * @date 2019-12-27
 */
@Service
@DataSource(value = DataSourceType.POEM)
public class PkSubjectServiceImpl implements IPkSubjectService {

	@Autowired
	private PkSubjectMapper pkSubjectMapper;

	/**
	 * 查询诗词考题
	 * 
	 * @param id 诗词考题ID
	 * @return 诗词考题
	 */
	@Override
	public PkSubject selectPkSubjectById(Integer id) {
		return pkSubjectMapper.selectPkSubjectById(id);
	}

	/**
	 * 查询诗词考题列表
	 * 
	 * @param pkSubject 诗词考题
	 * @return 诗词考题
	 */
	@Override
	public List<PkSubject> selectPkSubjectList(PkSubject pkSubject) {
		return pkSubjectMapper.selectPkSubjectList(pkSubject);
	}

	/**
	 * 新增诗词考题
	 * 
	 * @param pkSubject 诗词考题
	 * @return 结果
	 */
	@Override
	public int insertPkSubject(PkSubject pkSubject) {
		return pkSubjectMapper.insertPkSubject(pkSubject);
	}

	/**
	 * 修改诗词考题
	 * 
	 * @param pkSubject 诗词考题
	 * @return 结果
	 */
	@Override
	public int updatePkSubject(PkSubject pkSubject) {
		return pkSubjectMapper.updatePkSubject(pkSubject);
	}

	/**
	 * 删除诗词考题对象
	 * 
	 * @param ids 需要删除的数据ID
	 * @return 结果
	 */
	@Override
	public int deletePkSubjectByIds(String ids) {
		return pkSubjectMapper.deletePkSubjectByIds(Convert.toStrArray(ids));
	}

	/**
	 * 删除诗词考题信息
	 * 
	 * @param id 诗词考题ID
	 * @return 结果
	 */
	@Override
	public int deletePkSubjectById(Integer id) {
		return pkSubjectMapper.deletePkSubjectById(id);
	}
}
